package com.tsingtree.modular.model.result;

import com.tsingtree.modular.enums.CommonStatusEnum;
import com.tsingtree.modular.enums.SexTypeEnum;
import com.tsingtree.modular.enums.UserConditionEnum;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

/**
 * <p>
 * 用户
 * </p>
 *
 * @author jagger
 * @since 2023-08-29
 */
@Data
public class NanUserResult implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;

    private Date createTime;

    private Date updateTime;

    private Integer version;

    private String registerIp;

    private Integer status;

    private String email;

    private String pwd;

    private Integer sex;

    private String nickName;

    private String avatar;

    private String birthday;

    private Integer weight;

    private Integer height;

    private String country;

    private String statusStr;

    private String sexStr;

    private String device;
    private Integer sellerId;

    private String deviceCode;

    private Boolean isOfficial;

    private Boolean isVip;

    private Boolean isAllowedAdd;

    private Integer chatCondition;

    private String chatConditionStr;

    public String getChatConditionStr() {
        return UserConditionEnum.getAll().get(chatCondition);
    }

    public String getSexStr() {
        if(Objects.isNull(sex)){
            return "未知";
        }
        return SexTypeEnum.getAll().get(sex);
    }

    public String getStatusStr() {
        return CommonStatusEnum.getAll().get(status);
    }

    private String tag;

    private String tagStr;

}
